{% extends "base.html" %}

{% block title %}重置密码 - DRF 学习项目{% endblock %}

{% block content %}
<div class="auth-container">
    <div class="text-center mb-4">
        <h2 class="h4 mb-3">🔄 重置密码</h2>
        <p class="text-muted">请输入您的邮箱地址，我们将发送重置链接</p>
    </div>

    {% if form.errors %}
        <div class="alert alert-danger">
            {% for field, errors in form.errors.items %}
                {% for error in errors %}
                    <div>{{ error }}</div>
                {% endfor %}
            {% endfor %}
        </div>
    {% endif %}

    <form method="post">
        {% csrf_token %}

        <div class="mb-3">
            <label for="{{ form.email.id_for_label }}" class="form-label">邮箱地址</label>
            <input type="email" class="form-control" id="{{ form.email.id_for_label }}"
                   name="{{ form.email.name }}" value="{{ form.email.value|default:'' }}"
                   placeholder="请输入您的邮箱地址" required>
        </div>

        <div class="d-grid gap-2">
            <button type="submit" class="btn btn-primary btn-lg">发送重置链接</button>
            <a href="{% url 'login' %}" class="btn btn-secondary">返回登录</a>
        </div>
    </form>

    <!-- 提示信息 -->
    <div class="mt-4 p-3 bg-warning bg-opacity-10 rounded">
        <h6 class="text-warning mb-2">⚠️ 开发环境说明</h6>
        <small class="text-muted">
            <div>这是开发环境，邮件功能未配置</div>
            <div>请联系管理员重置密码</div>
            <div>或使用测试账户进行登录</div>
        </small>
    </div>
</div>
{% endblock %}
